package com.b2j.base;

import java.util.ArrayList;
import java.util.List;

public class ProcessData {

	public enum Type {PROCESS, FUNCTION, LANGUAGE, SCOPE}
	
	public Type type;
	public String name;
	public List<Variable> listVariables;
	public String code;
	public List<String> imports;
	public Routine generator;
	public String returnType;

	public ProcessData(Type type, String name) {
		this.type = type;
		this.name = name;
		this.returnType = "";
		
		this.listVariables = new ArrayList<Variable>();
		this.code = "";
		this.imports = new ArrayList<String>();
		
		this.generator = new Routine(this);
		
	}

	public ProcessData(Type type, String name, String returnType) {
		this.type = type;
		this.name = name;
		this.returnType = returnType;
		
		if (type == ProcessData.Type.FUNCTION && returnType.isEmpty())
			this.returnType = "int";
		else if (returnType.toLowerCase().equals("string"))
			this.returnType = MainTools.tools.formatClassName(returnType);
			
		this.listVariables = new ArrayList<Variable>();
		this.code = "";
		this.imports = new ArrayList<String>();
		
		this.generator = new Routine(this);
		
	}

}
